<%@ page language="java" import="java.util.*" import="java.sql.*" import = "orm.*"  pageEncoding="utf-8" errorPage="errorPage.jsp"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<% 	User tea  =(User) session.getAttribute("Teacher");  
	if (tea == null){
		response.sendRedirect(path + "/index.jsp");
	}
	List curtests =(List)session.getAttribute("CurTests");
	Vector v = new Vector();
	for(int i=0;i<curtests.size();i++)
	{
	   v.add(new Long(((Test)curtests.get(i)).getCourse().getCourseid()));
	  
	}
%>

<head>
<base href = "<%=basePath %>"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome-Online Test</title>
<link href="css/tStyles.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
	<!-- CONTAINER START -->
	<div id = "container">
		<!-- HEADER START -->
        <div id = "top">
        	<div id = "navigation">
            	<html:link page="/teacher/teacher.jsp" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;首页</html:link>
                <html:link page="/teacher/notice.jsp" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;通知</html:link>
                <html:link action="manageQuestions.do?action=startManagement" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;题库</html:link>
                <html:link action="manageKnowledges.do?action=startManagement" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;知识点</html:link>
                <html:link action="manageTemplates.do?action=startManagement" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;试卷模板</html:link>
                <html:link action="gradeManagement.do?action=startMana" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;成绩管理</html:link>
                <html:link page="/teacher/studentMana.jsp" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;学生管理</html:link>
            </div>
        </div>
        <!-- HEADER END -->
        
		<!-- LOGIN START -->
        <div id = "login">
        	<div id = "name">
        	<%=tea.getRealname()%>
            </div>
        	<html:link page="/teacher/teacherInfo.jsp" styleClass="viewInfo">·查询个人信息</html:link>
          	<p><html:link page="/teacher/teaModifyPwd.jsp" styleClass="modifyPwd">·修改密码</html:link></p>
            <p><html:link page="/teacher/letter.jsp" styleClass="letter">·站内信</html:link></p>
            <p><html:link forward="logout" styleClass="logout">·注销登录</html:link></p>
  		</div>
        <!-- LOGIN END -->
        
        <!-- CLOCK START -->
  		<div id = "clock">
        	<iframe src="index/clock.html" height="407" width="296" frameborder="0" scrolling="no"
            		marginheight="0" marginwidth="0" id="clockFrame" name="clockFrame"></iframe>
		</div>
        <!-- CLOCK END -->
        
        <!-- MAIN START -->
      	<div id = "main">
        	<div id = "notice">
            	【当前考试】
                <table>
                	<tr>
                	<% for(int i=0;i<curtests.size();i++){
                	 %>
                		<td>&nbsp;&nbsp;&nbsp;<a href="testMonitor.do?action=startexam&courseid=<%= ((Long)v.get(i)) %>")
                		
                		 >.
                		<%= ((Test)curtests.get(i)).getTestname() %></a></td>
                     <%} %>
                   
                    <% if(curtests.size()==0){ %>
                        <td>当前无任何考试!</td>
                    <%} %>
                    </tr>
                </table>
            </div>
        	<div id = "notice">
            	<a href="notice.jsp">【通知】</a>
                <table>
                	<tr>
                		<td>&nbsp;&nbsp;&nbsp;<a href="#">准备吃饭</a></td>
                        <td title="time">2011-03-30 21:00</td>
                    </tr>
                </table>
            </div>
   	  	</div>
	<!-- MAIN END -->
        
	<!-- FOOTER START -->
	<div id = "footer">
  </div>
	<!-- FOOTER END -->
        
</div>
    <!-- CONTAINER END -->
    
</body>
</html>
